package com.stanyung.realtimeserver.codec;

import org.apache.mina.core.session.IoSession;
import org.apache.mina.filter.codec.ProtocolCodecFactory;
import org.apache.mina.filter.codec.ProtocolDecoder;
import org.apache.mina.filter.codec.ProtocolEncoder;

public class ChatProtocolCodecFactory implements ProtocolCodecFactory {
	
	private ChatProtocolEncoder protocolEncoder;
	private ChatProtocolDecoder protocolDecoder;
	
	public ChatProtocolCodecFactory() {
		this.protocolEncoder = new ChatProtocolEncoder();
		this.protocolDecoder = new ChatProtocolDecoder();
	}

	@Override
	public ProtocolEncoder getEncoder(IoSession session) throws Exception {
		return protocolEncoder;
	}

	@Override
	public ProtocolDecoder getDecoder(IoSession session) throws Exception {
		return protocolDecoder;
	}

}


